<template>
  <el-card class="box-card">
    <div slot="header" class="clearfix">
      <span>能耗趋势</span>
    </div>
    <div class="text item">
      <div id="Trend" style="width: 100%;height: 400px"></div>
    </div>
  </el-card>

</template>

<script>
import {getEmissionOverall} from "@/api/dtct/dataCenter";

export default {
  name: "Trend",
  mounted() {
    this.initEchart();
  },
  methods: {
   
    initEchart() {

     
        let myChart = this.$echarts.init(document.getElementById('Trend'));

        let option = {
         title: {
    text: '能耗值'
  },
  tooltip: {
    trigger: 'axis'
  },
  legend: {
    data: ['碳排放量', '碳减排量']
  },
  grid: {
    left: '3%',
    right: '4%',
    bottom: '3%',
    containLabel: true
  },
  toolbox: {
    feature: {
      saveAsImage: {}
    }
  },
  xAxis: {
    type: 'category',
    boundaryGap: false,
    data: ['2018', '2019', '2020', '2021', '2022', '2023']
  },
  yAxis: {
    type: 'value'
  },
  series: [
    {
      name: '碳排放量',
      type: 'line',
      stack: 'Total',
      data: [9588888, 9288888, 10000000, 10000000, 9588888, 47000000]
    },
    {
      name: '碳减排量',
      type: 'line',
      stack: 'Total',
      data: [23000000, 23000000, 23000000, 23000000, 23000000, 50000000, ]
    },

  ]
        };

        option && myChart.setOption(option);
      }
  }
}
</script>

<style scoped>

</style>
